<script setup>
import $cmpnt from "xcore/cmpnt"
import $data from "xcore/data"
</script>
<template>

    <el-dropdown trigger="click">
        <span class="bg-white p-1 rounded add">
            <i class="iconfont te-i-add"></i>组件
        </span>
        <template #dropdown>
            <el-dropdown-item @click="$data.func.addCmpnt(item.clone())" v-for="item in $cmpnt.widgets" :key="item.id">
                <i :class="item.ctl.icon"></i> {{ item.ctl.text }}
            </el-dropdown-item>
        </template>
    </el-dropdown>


</template>
<style scoped>
.add {
    width: 60px;
    height: 100%;
    border: var(--xcode-editable-border-hover);
    color: var(--xcode-editable-bgcolor01)
}
</style>